package com.winchain.chainbill.bill.biz.query.controller;

import com.shell.bee.base.annotation.Logging;
import com.shell.bee.base.exception.UnCheckMsgException;
import com.shell.bee.base.utils.StringUtil;
import com.winchain.chainbill.bill.base.po.CbCert;
import com.winchain.chainbill.bill.base.service.CbCertService;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class CertController {
	@Autowired
	private CbCertService cbCertService;

	@RequestMapping
	@ResponseBody
	@Logging(module = "��������", methods = "��������id��������")
	public List<CbCert> selectCertByBillIds(String billIds, String bizIds, String billTypes) {
		if (StringUtil.emptyAndNull(billIds)) {
			throw new UnCheckMsgException("��������������");
		}
		String[] bizId = null;
		if ((!StringUtil.emptyAndNull(billTypes)) && (("12".equals(billTypes)) || ("11".equals(billTypes))
				|| ("13".equals(billTypes)) || ("10".equals(billTypes)))) {
			bizId = bizIds.split(",");
		}
		return this.cbCertService.selectCertByBillIds(billIds.split(","), bizId);
	}
}
